import React, { Component } from 'react';

class App extends Component {
    constructor(props){
        super(props);
        this.fileRef = React.createRef();
    }
    state ={
        file:"",
    }
    handleClick =(params) => {
        console.log(this.fileRef.current)
    }
    render() {
        return (
            <div>
                <input type="file" ref={this.fileRef}/>
                <button onClick={this.handleClick}>获取fileDom元素</button>
            </div>
        );
    }
}

export default App;
